package com.apes.autoparts.product.model;

import com.apes.framework.jpa.BaseModel;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * 类描述：EPC版本对照
 *
 * @ClassName EPCVersionContrast
 * @Description 描述
 * @Author wushilong
 * @Date 2022/10/8 16:48
 * @Version 1.0
 */

@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = EPCVersionContrast.CONST_TABLE_NAME, indexes = {
        @Index(name = "idx_auto_label", columnList = "auto_label", unique = true)})
public class EPCVersionContrast extends BaseModel {
    public static final String CONST_TABLE_NAME = "EPC_version_contrast";

    @Id
    @Column(name = "id", length = 10)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "EPC版本对照")
    @Comment("编码")
    private String id;

    @Column(name = "auto_brand", nullable = false, length = 100)
    @Comment("汽车品牌")
    private String autoBrand;

    @Column(name = "epc_version", nullable = false, length = 100)
    @Comment("EPC版本号")
    private String epcVersion;

    @Column(name = "auto_label", nullable = false, length = 100)
    @Comment("汽车厂牌")
    private String autoLabel;
}
